package com.pitaya.avatar.util;

import com.pitaya.avatar.domain.House;;

public class HouseMatcher {
	public static boolean update(House houseOld,House houseNew) {
		if(houseOld == null || houseNew == null) {
			return false;
		}
		if(houseOld == houseNew) {
			return true;
		}
		
		if(houseOld.getLongitude() != houseNew.getLongitude()) {
			houseOld.setLongitude(houseNew.getLongitude());
			
		}
		
		if(houseOld.getLatitude() != houseNew.getLatitude()) {
			houseOld.setLatitude(houseNew.getLatitude());
		}
		
		if(houseOld.getName().equals(houseNew.getName()) == false) {
			houseOld.setName(houseNew.getName());
		}
		
		if(houseOld.getLetters().equals(houseNew.getLetters()) == false) {
			houseOld.setLetters(houseNew.getLetters());
		}
		
		
		
		if(houseOld.getHid().equals(houseNew.getHid()) == false) {
			houseOld.setHid(houseNew.getHid());
		}
		
		if(houseOld.getCalendar().equals(houseNew.getCalendar()) == false) {
			houseOld.setCalendar(houseNew.getCalendar());
		}
		
		return true;
	}
}
